home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / Anim / Dissolve / ZigZag < prev   
Text File  |  2001-10-01  |  2KB  |  122 lines

  1. /* Dissolve ZigZag
  2. 101
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.  
  9.     parse ARG Port Opt1 Opt2 Opt3 s0 t0 s1 t1 b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     w=result
  15.     pp_GetHeight
  16.     h=result
  17.     pp_GetDepth
  18.     D=result
  19.  
  20.     pp_GetCurrentBuffer
  21.     CBf=result
  22.     pp_GetCurrentBrush
  23.     CB=result
  24.  
  25.     pp_FindEmptyBrush
  26.     Brush=result
  27.     if Brush=-1 then DO
  28.         pp_Warn "can't*find*empty|Brush."
  29.         EXIT        
  30.     END
  31.     pp_SetBrush Brush        
  32.  
  33.     pp_FindEmptyBuffer
  34.     Bf=result
  35.     if Bf=-1 then DO
  36.         pp_Warn "can't*find*empty|Buffer."
  37.         EXIT        
  38.     END
  39.     pp_SetBuffer Bf
  40.  
  41.     pp_New w h 24
  42.     pp_SpareOnOff
  43.  
  44.     /* Draw your Mask */
  45.         pp_ClearRange 0
  46.         IF Opt3=3 then DO
  47.             pp_setRange 0 0 0 0 0
  48.             pp_setRange 0 19 255 255 255
  49.             pp_Gradient 0 0 0 0
  50.         END
  51.         IF Opt3=2 then DO
  52.             pp_setRange 0 19 0 0 0
  53.             pp_setRange 0 0 255 255 255
  54.             pp_Gradient 0 0 0 0
  55.         END
  56.         IF Opt3=0 then DO
  57.             pp_setRange 0 0 0 0 0
  58.             pp_setRange 0 19 255 255 255
  59.             pp_Gradient 0 1 0 0
  60.         END
  61.         IF Opt3=1 then DO
  62.             pp_setRange 0 19 0 0 0
  63.             pp_setRange 0 0 255 255 255
  64.             pp_Gradient 0 1 0 0
  65.         END
  66.  
  67.         pp_EffectOn
  68.         pp_ComposeReqOff
  69.         pp_BoxF 0 0 w-1 h-1
  70.         pp_Sin 1 9 293 9 293
  71.         pp_BoxF 0 0 w-1 h-1        
  72.         pp_ComposeReqOn
  73.         pp_EffectOff
  74.  
  75.     /*    End    */
  76.     
  77.     pp_SparetoStencil
  78.     pp_SSave "ram:DisSten"
  79.     pp_ClearCurrentBuffer
  80.     pp_SetBuffer CBf
  81.  
  82.     pp_SLoad "ram:DisSten"
  83.     ADDRESS COMMAND
  84.     'delete >nil: ram:DisSten'
  85.     ADDRESS value Port
  86.  
  87.     pp_GotoFrame s1
  88.     pp_PicttoSpare
  89.     pp_GotoFrame s0            
  90.     pp_Pickbrush 0 0 W H 1
  91.     
  92.     step=(s1-s0)
  93.     Step_f=255/Step
  94.  
  95.     DO i=s0 to s1
  96.         IF t1=1 then DO
  97.             pp_GotoFrame (s1+i-s0)
  98.             pp_PicttoSpare
  99.         END
  100.  
  101.         pp_GotoFrame i
  102.  
  103.         IF t0=0 then DO
  104.             pp_plot W/2 H/2
  105.         END
  106.  
  107.         f=Step_f*(i-s0)
  108.         IF Opt1=0 then DO
  109.             pp_Dissolve f 255            
  110.         END
  111.         ELSE DO
  112.             pp_Dissolve f f
  113.         END
  114.         pp_Refresh
  115.     END
  116.  
  117.         pp_Gotoframe s0
  118.         pp_FreeBrush
  119.         pp_SetBrush CB
  120.  
  121.     EXIT
  122.